package com.mobiporter.adias.tags;

import java.util.List;

import javax.servlet.jsp.JspException;

import com.mobiporter.adias.constants.RequestScopeObjects;
import com.mobiporter.adias.tags.model.SelectItem;

public class SelectBoxOption extends MobiTag 
{
	
	private static final long serialVersionUID = -4034158713549413026L;
	private String name ;
	private String value ;
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getValue() {
		return value;
	}
	public void setValue(String value) {
		this.value = value;
	}
	
	
	@Override
	public void setValueToControl(String value) {}
	
	@Override
	public int doEndTag() throws JspException 
	{
		return EVAL_PAGE ;
	}
	
	@SuppressWarnings("unchecked")
	@Override
	public int doStartTag() throws JspException 
	{
		List<SelectItem> mapItems =  (List<SelectItem>) pageContext.getRequest().getAttribute(RequestScopeObjects.SELECT_BOX_VALUES);
		SelectItem item = new SelectItem() ;
		item.setKey(getName());
		item.setValue(getValue());
		mapItems.add(item);
		return SKIP_BODY ;
	}
	
	
	
	
}
